package com.neusoft.ysu.npms.controller;


import com.neusoft.ysu.npms.pojo.Result;
import com.neusoft.ysu.npms.pojo.Secondrisk;
import com.neusoft.ysu.npms.service.ISecondriskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 作者：刘金秋
 * @since 2024-06-18
 */
@RestController
@RequestMapping("/secondrisk")
public class SecondriskController {
    @Autowired
    ISecondriskService isecondriskService;
    @RequestMapping("/add")
    public Result add(@RequestBody Secondrisk secondrisk) {isecondriskService.add(secondrisk);return Result.success();}
    @RequestMapping("/delete")
    public Result deleteSrisk(@RequestBody Secondrisk secondrisk) {isecondriskService.deleteSrisk(secondrisk);return Result.success();}
    @RequestMapping("/update")
    public Result updateSrisk(@RequestBody Secondrisk secondrisk){isecondriskService.updateSrisk(secondrisk);return Result.success();}
    @RequestMapping("/getAll")
    public Result getAll(){return isecondriskService.selectAll();}
    @RequestMapping("/findone")
    public Result findone(@RequestBody Secondrisk secondrisk){
        System.out.println(secondrisk);
        isecondriskService.findById(secondrisk);
        return Result.success();}
}
